import { debounce } from './utils';
import BackTop from 'components/content/backTop/BackTop'


export const itemListenerMixin = {
    mounted() {
        let newRefresh = debounce(this.$refs.scroll.refresh, 200)
        this.itemImageListener = () => {
            newRefresh()
        }
        this.$bus.$on('itemImageLoad', this.itemImageListener)
    },
}

export const backTop = {
    data() {
        return {
            isShowBackTop: false,
        }
    },
    components: {
        BackTop
    },
    methods: {
        backClick() {
            this.$refs.scroll.scrollTo(0, 0, 500);
        },
    },
}